﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using MySql.Data.MySqlClient;
using System.Data;

namespace ProjectBuilder
{
    [DbTable("phpdoc_variable")]
    public class Variable : BaseDocObject
    {        
        [DbField("class_id")]
        public long? ClassId { get; set; }

        [DbField("name")]
        public string Name { get; set; }

        [DbField("static", IsUniqField = false)]
        public int Static { get; set; }

        [DbField("is_abstract", IsUniqField = false)]
        public int IsAbstract { get; set; }

        [DbField("access", IsUniqField = false)]
        public string Access { get; set; }

        [DbField("line", IsUniqField = false)]
        public int Line { get; set; }

        [DbField("default_value", IsUniqField = false)]
        public string Default { get; set; }

        [DbField("short_description", IsUniqField = false)]
        public string ShortDescription { get; set; }

        [DbField("description", IsUniqField = false)]
        public string Description { get; set; }

        [DbField("type", IsUniqField = false)]
        public string Type { get; set; }

        public Variable(ProjectBuilder.PhpDocTypes.Var var, long? classId)
        {
            ClassId = classId;
            Default = var.Default;
            Line = var.Line;
            Name = var.Name;
            ShortDescription = var.ShortDescription;
            Description = var.Descrition;
            Static = var.Static;
            Type = var.Type;
        }

        public void Save()
        {
            GetDBId();
        }
    }
}